import greenfoot.*;  // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)

/**
 * Pista del escenario en la que se simula el movimiento.
 * 
 * @author Asael Hernández García 
 * @version (a version number or a date)
 */
public class Pista extends Actor
{
    /**
     * Act - do whatever the Pista wants to do. This method is called whenever
     * the 'Act' or 'Run' button gets pressed in the environment.
     */
    private Linea linea;
    private SimpleTimer timer;
    
    public Pista()
    {
        linea = new Linea();
        timer = new SimpleTimer();
        timer.mark();
    }
    
    public void act() 
    {
        if( getWorld().getObjects(Linea.class).size() < 3 && timer.millisElapsed() > 3000){
            linea = new Linea();
            getWorld().addObject(linea,449, 561);
            timer.mark();
        }
    }    
}
